package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysReserveLogMapper;
import com.ruoyi.system.domain.SysReserveLog;
import com.ruoyi.system.service.ISysReserveLogService;
import com.ruoyi.common.core.text.Convert;

/**
 * 预约记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2019-09-02
 */
@Service
public class SysReserveLogServiceImpl implements ISysReserveLogService 
{
    @Autowired
    private SysReserveLogMapper sysReserveLogMapper;

    /**
     * 查询预约记录
     * 
     * @param id 预约记录ID
     * @return 预约记录
     */
    @Override
    public SysReserveLog selectSysReserveLogById(Long id)
    {
        return sysReserveLogMapper.selectSysReserveLogById(id);
    }

    /**
     * 查询预约记录列表
     * 
     * @param sysReserveLog 预约记录
     * @return 预约记录
     */
    @Override
    public List<SysReserveLog> selectSysReserveLogList(SysReserveLog sysReserveLog)
    {
        return sysReserveLogMapper.selectSysReserveLogList(sysReserveLog);
    }

    /**
     * 新增预约记录
     * 
     * @param sysReserveLog 预约记录
     * @return 结果
     */
    @Override
    public int insertSysReserveLog(SysReserveLog sysReserveLog)
    {
        sysReserveLog.setCreateTime(DateUtils.getNowDate());
        return sysReserveLogMapper.insertSysReserveLog(sysReserveLog);
    }

    /**
     * 修改预约记录
     * 
     * @param sysReserveLog 预约记录
     * @return 结果
     */
    @Override
    public int updateSysReserveLog(SysReserveLog sysReserveLog)
    {
        sysReserveLog.setUpdateTime(DateUtils.getNowDate());
        return sysReserveLogMapper.updateSysReserveLog(sysReserveLog);
    }

    /**
     * 删除预约记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysReserveLogByIds(String ids)
    {
        return sysReserveLogMapper.deleteSysReserveLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除预约记录信息
     * 
     * @param id 预约记录ID
     * @return 结果
     */
    public int deleteSysReserveLogById(Long id)
    {
        return sysReserveLogMapper.deleteSysReserveLogById(id);
    }
}
